package com.example.experiment1;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvFileSource;

import static org.junit.jupiter.api.Assertions.assertEquals;


public class TriangleTest {

    @DisplayName("一般性边界测试")
    @ParameterizedTest
    @CsvFileSource(resources = "/一般边界测试样例.csv")
    void normal_test(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        String result = triangle.classify(a, b, c);
        assertEquals(expected, result);
    }

    @DisplayName("健壮性边界测试")
    @ParameterizedTest
    @CsvFileSource(resources = "/健壮性边界测试样例.csv")
    void robustness_test(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        String result = triangle.classify(a, b, c);
        assertEquals(expected, result);
    }

    @DisplayName("弱一般等价类测试")
    @ParameterizedTest
    @CsvFileSource(resources = "/弱一般等价类测试样例.csv")
    void equivalence_test(int a, int b, int c, String expected) {
        Triangle triangle = new Triangle();
        String result = triangle.classify(a, b, c);
        assertEquals(expected, result);
    }

}
